This invention relates to manipulating graphic objects in 3D scenes.
The computer system illustrated in FIG. 1xe2x80x94which includes mouse 15, keyboard 16, CPU 17 and CRT 18xe2x80x94represents a hardware setup for running software that allows a user to view and/or create 3D scenes. A 3D scene typically comprises one or more graphic entities placed in a background setting to create an informative or aesthetically pleasing image. Such 3D scenes may be used in generating image data files (e.g., GIF or JPEG), web pages (e.g., HTML files), 3D worlds (e.g., VRML files) or may be strung together in a sequence to create an animated 3D movie (e.g., MPEG-1 or Quicktime files). These 3D scenes are xe2x80x9cvirtualxe2x80x9d in the sense that the space they occupy and their graphic entities and characteristics are conceptual rather than actual, but possess the functional (e.g., optical and spatial) properties of the physical entities that they represent.
To compose a 3D scene, a user (e.g., a graphical content developer) typically uses an interactive, graphic drawing application to construct several 3D entities from individual graphic elements such as polygons, edges (or lines) and points. The user can manipulate the 3D entities and their respective elements, for example, through sizing (or scaling), positioning (or translating) and orienting (or rotating) operations, until the scene has the desired appearance. FIG. 2 shows an example of a 3D scene composed of several graphic entities such as a table 20, a ruler 21, a chair 22 and a model X-29 aircraft 23 within a room formed of walls 24 and a tiled floor 25. To create this scene, the user had to carefully compose and arrange each of the graphic entities and their elements to be properly oriented, positioned and scaled relative to the other entities and elements in the scene. Additionally, such composition and arrangement must be performed on elements within an entity such that they are properly oriented, positioned and scaled relative to other elements within the same graphic entity.
An xe2x80x9cobjectxe2x80x9d refers to one or more graphical entities, one or more graphical elements forming a graphical entity, or some combination of graphical entities and elements. Hence any statement regarding manipulation, composition or arrangement of graphical objects may be applied equally to graphical entities or graphical elements, either alone or in combination.
Using conventional systems and methods to create graphic scenes of any complexity can be a painstaking and time-consuming process. Generally a user is required to manually create and manipulate graphic objects using mouse pointing and click-and-drag techniques that require considerable degrees of hand-eye coordination and practice and often several iterations of trial-and-error. These tasks are considerably more difficult when creating a 3D scene because the user must manipulate objects in a virtual 3D space using two-dimensional input (e.g., the user""s movement of the mouse along the plane of the mouse pad). As a result, mouse movements frequently are misinterpreted by the graphics program, resulting in undesired object manipulationsxe2x80x94that is, objects will have skewed features or will end up in the wrong location or orientation.
Several different visual object manipulation tools have been developed to aid users in manipulating objects in 3D scenes. These tools may or may not appear temporarily within the 3D scene, however, they are not a part of the 3D scene that is the final product. Rather, they appear on the display screen only while the 3D scene is being authored to assist a user in manipulating graphic objects.
Object manipulation tools generally fall into two different categories: indirect and direct. With indirect manipulation tools, the user does not work within the 3D scene itself but rather uses a separate graphical abstraction which lies outside the 3D scene, typically at a fixed location on the display screen, to bring about corresponding changes to the graphic object. An example of an indirect manipulation tool is a slider bar or thumbwheel, provided as part of the graphic user interface (GUI), which causes a graphic object to rotate about a single axis or translate along one axis in response to input from a user.
Direct manipulation tools, in contrast, allow a user to manipulate a graphic object directly by placing the cursor in the proximity of the object, and dragging the cursor within the scene to affect the desired change to the object. An example of a direct object manipulation tool is a manipulator box having visual features which enable a user to translate, rotate and scale a graphic object encompassed within the manipulator box.
As shown in FIG. 2, for example, a manipulator box 26 having boundary line 28 encompasses the X-29 aircraft 23. The user can translate the X-29 within the scene by clicking the cursor anywhere on one of the box""s faces and dragging the cursor to the desired location. In response, the X-29 and the manipulator box will follow the cursor""s movement. The user can scale the aircraft by clicking the cursor on one of the white cubes 27 at each vertex of the manipulator box and dragging the cursor in the desired direction. If the user drags a white cube 27 inward towards the aircraft, the X-29 and the manipulator box become proportionately smaller. In contrast, the X-29 and the manipulator box become larger if the user drags a white cube 27 away from the aircraft. The X-29 can be rotated by clicking on and dragging one of the green spheres 29 which causes the X-29 and the manipulator box to rotate about a single one of the three axes of the manipulator box.
The three lines connecting the three sets of green spheres 29 define the three different axes of rotation for the manipulator box 26. The axis about which the rotation occurs is determined by considering which knob is selected and, following selection of the knob, the initial direction of motion of the cursor. The net result is that the knob rotates about one of the two axes to which the knob is not attached, carrying the manipulator box and the X-29 along with it.
Object manipulation tools, both direct and indirect, may serve several purposes. First, the tools may provide visual cues or feedback which better enable a user to manually position an object so that it will end up at the desired location and orientation. For example, some 3D drawing applications provide a two-dimensional grid 30 as shown in FIG. 3 which enables users to manually position a graphic object within a 3D scene with increased precision, and thereby achieve consistency and proportionality throughout the scene. A grid typically is implemented as a plane containing two perpendicular axes of a 3D coordinate system. The third axis, called the plane normal, is perpendicular to the first two axes and therefore perpendicular to the plane of the grid as well. In FIG. 3, grid 30 contains the Y and X axes and the plane normal is the Z axis. A user can align graphic objects to the grid or position one object a desired number of units from another object.
Object manipulation tools also may allow a user to selectively constrain the motion of a graphic object during manipulation relative to one or more axes of a coordinate system. Attempting to interpret 2D mouse movements as fully 3-dimensional gestures with simultaneous motion in all 3 dimensions is an exceedingly difficult, if not impossible, is task. Users accordingly can instruct the program to interpret mouse movements as corresponding to a single direction along a designated axis (i.e., one-dimensional motion constrained to a single axial direction within or perpendicular to a plane) or within a designated plane (i.e., two-dimensional motion constrained to the plane defined by two axes of a coordinate system). The re-interpreted, constrained mouse motion can be used to apply any type of object manipulation, including translation, rotation and scaling. The purpose of constraining motion to fewer than all three axes is to divide the difficult task of moving an object in virtual 3D space into several more manageable subtasks. Rather than forcing a user to be so deft at mouse control as to be able to move an object precisely from one point in 3D space (e.g., 0, 3, 27) to another point in 3D space (e.g., 60, 4, 2) with a single mouse movement, the user can make three separate movements: one constrained to motion along the X-axis (from (0, 3, 27) to (60, 3, 27)), a second movement constrained to motion along the Y-axis (from (60, 3, 27) to (60, 4, 27)) and a third movement constrained to motion along the Z-axis (from (60, 4, 27) to (60, 4, 2)). As a result, the likelihood of unintentional and incorrect movements is minimized because the object can translate only in a single direction during each sequential translation operation.
The motion of an object can be constrained relative to any of several different predefined coordinate systems, each of which defines a separate, predetermined xe2x80x9ccoordinate space.xe2x80x9d Within a single 3D scene, at least four different kinds of coordinate spaces can exist, each instance of which has its own independent set of axes. The axes for the different spaces need not, and typically will not, be aligned with each other. Rather, each different coordinate space defines a separate and independent frame of reference in which graphic objects can be manipulated.
First, all 3D scenes exist within a xe2x80x9cworld spacexe2x80x9dxe2x80x94an absolute coordinate system existing at the highest level of abstraction. Each scene has only one instance of a world space. In FIG. 2, for example, the room formed of walls 24 and a tiled floor 25 can be thought of as that scene""s world space.
Second, each entity within a 3D scene resides within its own xe2x80x9clocal spacexe2x80x9dxe2x80x94a local coordinate system that remains fixed relative to the elements forming the graphic entity. In FIG. 2, for example, the local space for the X-29 aircraft 23 may, but need not necessarily, be aligned with the manipulator box""s axes of rotation (i.e., the three lines connecting the three sets of green spheres 29).
Third, the computer screen defines a xe2x80x9cscreen spacexe2x80x9d having a Y-axis extending vertically along the screen, an X-axis extending horizontally along the screen and a Z-axis extending perpendicularly through the plane of the screen. Each scene has only one screen space coordinate system.
Lastly, graphic entities can be manipulated with reference to a xe2x80x9cparent spacexe2x80x9dxe2x80x94a space that is hierarchically one level above the entity""s local space. When a xe2x80x9cparentxe2x80x9d is moved, the xe2x80x9cchildxe2x80x9d moves along with it, while a child may be moved relative to and independent of its parent. The parent space of an entity is defined as the local space of the parent of that entity. For example, the X-29 in FIG. 2 sits on the table 20 and so the table may be regarded, but need not necessarily be regarded, as the parent of the X-29. If the table is the X-29""s parent, then moving the table simultaneously will move the X-29 an equal amount, while the X-29 xe2x80x9cchildxe2x80x9d may be moved independently of its parent, the table. And if the table is the X-29""s parent, then the X-29""s parent space is the table""s local space.
An example of constraining motion relative to the axes of a predefined coordinate space is illustrated in FIGS. 4A and 4B. The axes depicted in FIGS. 4A-B potentially could correspond to any of the four coordinate spaces described above. In this example, the user selectively constrains the movement of an object 40 so that, regardless of the mouse movements made by the user, the object 40 will move only in the direction of a single designated axis (X, Y or Z) within the coordinate space. In FIG. 4A, for example, the object 40 is at position 44 which has the XYZ coordinates (0, 0, N) relative to the origin 48 of the coordinate system. This means that the object 40 is located at 0 along both the X and Y-axes but at an offset N along the Z-axis. The object""s position as projected onto grid 30 is indicated by shadow 47. In this example, the user has constrained cursor motion to the X-axis direction as indicated by directional arrow 42. As the user drags the cursor 41 left-to-right generally in the direction pointed at by directional arrow 42, object 40, its manipulator box 46 and its shadow 47 move in the direction of the X-axis from position 44 in FIG. 4A to position 45 in FIG. 4B, which has the coordinates (D, 0, N). The Y and Z-axis coordinates of cursor 41 and object 40 remain constant throughout the translation operation, even if the mouse was moved in a direction other than along the X-axis. The user can constrain motion in this manner similarly along the Y or Z axes.
An object alternatively can be constrained to move freely within a single plane (i.e., in any combination of the directions of two axes), rather than in the direction of just a single axis. FIG. 5 shows a time-lapse view of an object 51 being translated within the plane of a two-dimensional grid 50 along an arbitrary cursor path 52. The grid 50 is aligned with the plane defined by the X and Z-axes of the coordinate space. As the user moves the cursor over the grid 50, the object 51 follows the cursor through successive positions P1-P7, each of which must remain on grid 50. In this plane-constrained manipulation mode, the user is unable to modify the Y-axis coordinate of the object 51.
Grid 50 in FIG. 5 also may provide a xe2x80x9csnappingxe2x80x9d effect. Snapping constrains the position of a graphic object to vertex points on the grid 50, which has a predefined spacing between the logical grid lines. As shown in FIG. 5, as the user moves object 51 along cursor path 52, the object xe2x80x9csnapsxe2x80x9d to a closest grid vertex point 53 even though the vertex point might be slightly outside of the cursor path. Snapping enables objects to be positioned relative to each other based on the positioning and granularity of the underlying logical grid.
A variation of plane-constrained snapping is illustrated in FIG. 6, which shows a time-lapse view of a single display screen 60 split into two side-by-side windows: a perspective view window 61 and an orthographic view window 62. In this mode, object 65 is constrained to a plane of motion that is parallel to, and separated an arbitrary distance from, grid 63 which is aligned with the plane defined by the X and Z-axes. A user can manipulate object 65 by clicking the cursor on the object while in the orthographic view window 62 and manipulating the object as desired within that window. The resulting movement is displayed in a perspective view in window 61. As shown in FIG. 6, the user moves the object 65 through successive positions P1-P7 along an arbitrary cursor path 64 in window 62 and the object snaps to positions above the grid 60 corresponding to vertex points 66 on the grid. The perspective view includes shadows S1-S7 corresponding to positions P1-P7 to give the user a visual indication of the object""s position as projected onto the grid.
Another variation of snapping is shown in FIG. 7 in which several objects 72, 73 and 74 are arranged on a grid 70. In this time-lapse view, a user has introduced (e.g. pasting, importing or creating) a new object 71 into the scene and drags it through the scene along an arbitrary cursor path 75. As the object 71 moves through successive positions P1-P13, the object automatically realigns itself such that its bottom surface snaps to the object surface to which it is closest. Between positions P8 and P9, for example, object 71 changes its orientation from having its bottom surface aligned with the front surface of block 73 to having its bottom surface aligned with a top surface 75 of cylinder 74. Object 71 remains in this same orientation until it reaches position P12, at which point object 71 reorients itself so that its bottom surface is aligned with the side surface 76 of cylinder 74. As the object 71 moves along cursor path 75, the object may encounter various snap points at key locations of different surfaces. For example, position P10 could correspond to a snap point at the center of the top surface 75 of cylinder 74. If the cursor passed close enough to this snap point, the object would automatically pull away from the cursor path and temporarily xe2x80x9cstickxe2x80x9d to (i.e., resist movement away from) position P10.
Other snapping techniques include the use of xe2x80x9csnap sourcesxe2x80x9d and xe2x80x9csnap targetsxe2x80x9d to effect a xe2x80x9cmove this to therexe2x80x9d operation. To reposition an object, the user will position a snap source identifier on the object to be manipulated and a snap target identifier at the desired location and orientation within the scene to which the object is to be moved. Upon activating the snap operation, the object will automatically translate and rotate so that the snap source identifier moves to, and becomes aligned with, the snap target identifier.
Many of the same or similar techniques as described above can be applied to object manipulations other than translationxe2x80x94e.g., scaling or rotating. For example, an object can be constrained to rotate about a single axis within a coordinate system or the object may be allowed to rotate freely in all three directions about its center point, which remains fixed. Similarly, the scaling of an object can be constrained relative to one or more axes of a coordinate system.
In one aspect, graphic objects in a 3D scene are manipulated using a computer system by defining a coordinate space (e.g., a 3D space) based on a feature (e.g., polygon, edge or point) of a graphic object in the 3D scene, and constraining a range of motion based on the defined coordinate system. A graphic object, or its constituent graphic elements, can be manipulated (e.g., translated, scaled or rotated) using the constrained range of motion. The motion can be constrained to a motion plane, to a single direction within the motion plane, or in a direction perpendicular to the motion plane. The definition of coordinate spaces and constrained ranges of motion can be integrated into the beginning stage of a standard cursor manipulation technique (e.g., a click-drag-release gesture) thus obviating the need for separate and distinct commands that tend to diminish user interface agility.
In defining the coordinate space, a motion surface (either a planar or non-planar entity) or motion plane can be specified. The motion plane can be aligned based on two dimensions of the coordinate space and is defined using a different heuristic depending on the type of feature under consideration. When the feature is a polygon, the motion plane is coplanar with the plane of the polygon. The motion plane for a polygon can be determined from two adjacent edges in the polygon, for example, a pair of adjacent edges closest to a specified position (e.g., a cursor position). When the feature is an edge, the motion plane is perpendicular to an average of normals of polygons (either all of the polygons or a subset thereof) touching that edge. When the feature is a point, the motion plane is calculated as a function of edges (either all of the edges or a subset thereof) that touch that point. In the case of a point, the motion plane approximates an average of planes touching that point, and can be calculated as the plane whose normal is the average of plane normals for edges that touch that point. Motion plane definition also can be based on a spatial relationship between the feature and other adjacent features. For any type of feature, a coordinate space defined according to one feature of a graphic object in the 3D scene is independent of a coordinate space defined according to another feature of a graphic object in the 3D scene.
The particular feature that is to be used in defining the coordinate space can be identified from input from a user (e.g., a mouse click). A new or different coordinate space is defined (or the same coordinate space is redefined) with each successive instance of input from the user. Other input received from the user can be used in constraining a range of available motion. For example, when the user clicks the mouse on a polygon, the range of motion is constrained to a plane that is coplanar with the polygon; when the user clicks the mouse on an edge, the range of motion is constrained to a plane that is perpendicular to an average of normals of polygons touching that edge; and when the user clicks the mouse on a point, the range of motion is constrained to a plane that is a function of edges touching that point.
The user input upon which coordinate spaces and constrained ranges of motion are defined may be integrated with the dragging that is typical of a xe2x80x9cclick-drag-releasexe2x80x9d gesture such that xe2x80x9cclickxe2x80x9d chooses a new coordinate space (or repeats the previous coordinate space) defined by three axial directions, xe2x80x9cdragxe2x80x9d moves in the chosen direction(s), and xe2x80x9creleasexe2x80x9d ends the gesture. Hence no input beyond the click-drag-release gesture is required, even though a new coordinate space, along with its associated directions, is specified each time.
Once defined, the constrained range of motion can be used in manipulating a graphic object. Manipulation is performed in a direct, as opposed to an indirect, manner by a user of the computer based on the constrained range of motion. The feature that is to be manipulated can be either the same as, or different from, the feature that was used is defining the coordinate space. Available types of manipulations include translating, rotating and scaling of features. Translation can occur freely within a motion plane defined by two dimensions of the coordinate space, or in a single direction within the motion plane or in a direction perpendicular to the motion plane. Rotation can occur in one dimension about a fixed axis or freely in all three dimensions about a fixed point. Scaling can involve enlarging or shrinking a feature equally across one, two or three dimensions about a fixed point.
Any single feature within the 3D scene can be manipulated independently or a collection of two or more features can be manipulated at the same time. In the latter case, the collection of features is manipulated in concert such that each feature is affected in an analogous manner as every other feature. One of the features can be designated as the master feature. In that case, only the master feature is directly manipulated by the user while the motion of the remaining features is automatically matched to that of the master feature.
The constrained range of motion can be used in aligning a graphic object, for example, by snapping the graphic object to a constrained position. Such aligning can include positioning a graphic object relative to another graphic object, relative to an absolute grid, or positioning the object with a relative grid. Different types of aligning include translating, rotating or scaling a graphic object until a spatial condition is met or an alignment event occurs. Users can be provided with visual and sensory feedback to aid in the alignment operation.
In another aspect, a graphic object manipulation tool includes at least one knob that controls a graphic object manipulation function, a planar indicator having a center point, and a linear indicator passing through the planar indicator""s center point in a direction perpendicular to the plane defined by the planar indicator. The planar indicator and the linear indicator automatically align themselves relative to a feature of the graphic object when the tool is placed on the feature. When the feature comprises a polygon, the tool realigns such that the plane of the planar indicator is coplanar with a plane of the polygon. When the feature comprises an edge, the tool realigns such that the linear indicator is colinear with the edge. When the feature comprises a point, the tool realigns such that the planar indicator is coplanar with a plane whose normal is the average of plane normals for edges that touch that point.
The manipulation functions that can be performed with the tool include rotating and scaling one or more features of a graphic object. The tool can have two or more knobs, for example, one knob positioned on the planar indicator for controlling rotation and another knob positioned on the linear indicator for controlling scaling. Rotating the rotation knob causes a corresponding rotation of the feature of the graphic object, either in one dimension about the tool""s linear indicator or in three dimensions freely about the center point of the tool.
To scale a feature of a graphic object, the scaling knob can be moved towards the tool""s center causing the feature to shrink or the knob can be dragged away from the tool""s center causing the feature to enlarge. The scaling can be controlled to occur equally in one, two or three dimensions about a fixed point. One dimensional scaling occurs along the linear indicator and about the planar indicator""s center. Two dimensional scaling occurs within the plane defined by the planar indicator and about the tool""s center. Three dimensional scaling also occurs about the tool""s center.
The manipulation tool can take a wide variety of forms. It can include at least one spoke extending from an edge point of the planar indicator to the planar indicator""s center point. A knob, for example, a rotation knob, can positioned at an intersection formed by the at least one spoke and an edge point on the planar indicator. Among other things, the planar indicator can be a wheel, a two-dimensional ring, a disk, a series of discrete points forming a discontinuous two-dimensional circle, a solid and continuous three-dimensional disk, or it can take a non-circular form. The linear indicator can be, among other things, an axle, a one-dimensional line, or a multi-dimensional rod (for example, having a cylindrical shape).
These feature-based manipulation tools and techniques provide users with simple yet powerful mechanisms that allow informative and/or aesthetically pleasing 3D scenes to be created rapidly, precisely and interactively. Rather than having to rely on predefined coordinate systems as frames of reference for manipulating objects, users can define their own coordinate systems dynamically based on any feature within the 3D scene. Each feature within the scene has an associated motion plane based on the type of feature (e.g., polygon, edge or point), its orientation within the scene, and the types and orientations of neighboring features. Users can specify, which each successive click of the mouse, motion planes that are independent of the predefined coordinate systems and use them to translate, rotate and/or scale any object (i.e., any single instance or collection of graphical entities and/or their constituent elements) within the scene. In performing these manipulation operations, users can constrain motion of the object relative to the motion plane. This includes the ability to constrain motion within the motion plane itself, to a single direction within the motion plane, and to a direction perpendicular to the motion plane.
Users can define motion planes and constrained ranges of motion and immediately move in those directions through quick, simple and standard cursor manipulation techniques such as mouse pointing, clicking and dragging. No special commands or equipment are required nor do any unconventional mouse manipulation techniques need to be learned. As a result, users can maintain a high degree of interface agility while manipulating objects.
The visual object manipulator described here, the PEP jack, provides users with a powerful and intuitive tool that can be used to scale or rotate any single instance or collection of graphical entities or their constituent elements within the scene. The PEP jack can align itself automatically relative to any feature as it is dragged through the scene. Because the particular orientation adopted by PEP jack depends on the type of feature to which it is attached, PEP jack is aligned automatically to the proper position to perform its scaling and rotating operations. The PEP jack""s scaling capabilities are highly flexible, allowing users to quickly and easily scale objects about a fixed point equally in one, two or three-dimensions. Similarly, the PEP jack allows users to rotate objects either in one-dimension about the PEP jack""s linear indicator or freely (i.e., unconstrained rotation in all three dimensions) about the PEP jack""s center point.
The ability to constrain motion in the manners described provides users with a rich body of object manipulation functionality. The mechanisms that supply this functionality are intuitive and powerful. They allow users to directly manipulate objects while providing qualitative and quantitative feedback, both visual and sensory. Using this feedback, users are able to quickly and precisely align objects, or features of objects, relative to each other, and in an absolute sense.
Other advantages and features will become apparent from the following description, including the drawings and claims.